#coding=utf-8
"""
Author:林怡
Time:2025/5/7 11:27
"""

class Pages_Element():
    # 1.输入用户名
    userName = ("id", "userAccount")

    # 2.输入密码
    passWord = ("id", "loginPwd")
    # 3.点击登录
    logBtn = ("id", "loginBtn")
    # 4.断言
    deskTop = ("xpath", "/html/body/div/section/div[1]/div[1]/ul/li/span")

    # 第二条用例
    # 定位用户中心
    userCenter = ("xpath","/html/body/div/aside/div/dl[1]/dt")

    #定位用户管理
    userManage = ("xpath","/html/body/div/aside/div/dl[1]/dd/ul/li[1]/a")

    # 添加用户管理的iframe框定位
    iframe1 = ("xpath","/html/body/div/section/div[2]/div[2]/iframe")

    #点击添加用户
    addUser = ("xpath","/html/body/div/div[2]/span[1]/a[2]")

    iframe2 = ("xpath", "/html/body/div[3]/div/iframe")
    #添加新用户
    Newuser = ("id","userName") #用户姓名
    telphone = ("id","user-tel") #手机号码
    email = ("id","user-email") #邮箱
    userAccount = ("id","userAccount") #登录账号
    loginPwd = ("id","loginPwd") #登录密码
    confirmPwd = ("id","confirmPwd") #再次确认登录密码
    submitBtn = ("id","submitBtn") # 确认按钮

    searchValue = ("id","searchValue") #查询用户框
    searchBtn = ("id","searchBtn") #搜用户按钮

    edit = ("xpath","/html/body/div/table/tbody/tr/td[9]/a[2]/i") #编辑按钮
    iframe3 = ("xpath","/html/body/div[3]/div/iframe")

    changepwd = ("xpath","/html/body/div/table/tbody/tr/td[9]/a[3]") #修改密码按钮
    iframe4 = ("xpath", "/html/body/div[3]/div/iframe")
    loginPwd2 = ("id","loginPwd2")
    button = ("xpath","/html/body/div/form/table/tbody/tr[3]/td/button") #确认按钮

    delbutton = ("xpath","/html/body/div/table/tbody/tr/td[9]/a[4]") #用户右边删除按钮
    delete = ("xpath","/html/body/div[3]/div[1]/span[2]/a[1]") #删除确认按钮


'''
上面这种把页面元素定位进行抽离的思想称为：PO设计模式
优点：
1.容易维护：好修改
2.可以使得元素和用例分离，当页面元素发生改变时，只需要修改当前页面的内容
3.可以降低代码的耦合性
4.可以更好的管理和组织自动化测试用例
'''
